package com.xwq.smartgelleryhub.config;


import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//@Configuration
//@ConfigurationProperties(prefix = "hotkey")
//@Data
public class HotKeyConfig {

    /**
     * Etcd 服务器完整地址
     */
    private String etcdServer = "http://127.0.0.1:2379";

    /**
     * 应用名称
     */
    private String appName = "smartgalleryhub";

    /**
     * 本地缓存最大数量
     */
    private int caffeineSize = 10000;

    /**
     * 批量推送 key 的间隔时间
     */
    private long pushPeriod = 1000L;

    /**
     * 初始化 hotkey
     */
//    @Bean
//    public void initHotkey() {
//        ClientStarter.Builder builder = new ClientStarter.Builder();
//        ClientStarter starter = builder.setAppName(appName)
//                .setCaffeineSize(caffeineSize)
//                .setPushPeriod(pushPeriod)
//                .setEtcdServer(etcdServer)
//                .build();
//        starter.startPipeline();
//    }
}
